<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>支付成功</h2>
    <span id="jumpTo">10</span>
    <button>返回</button>
    <script>

        // window.onload = () => {
        //     let time = 10;
        //     setInterval(() => {
        //         time--;
        //         document.getElementById("jumpTo").innerHTML = time;
        //         if (time == 0) {
        //             location.href = "https://www.bilibili.com/video/BV1ca4y1i7Lz/?spm_id_from=333.337.search-card.all.click&vd_source=14f845d15ed0c9eae38c9124e30f90b2";
        //         }
        //     }, 1000);
        // }

        // document.getElementsByTagName("button")[0].addEventListener("click", () => {
        //     location.href = "https://www.bilibili.com/video/BV1ca4y1i7Lz/?spm_id_from=333.337.search-card.all.click&vd_source=14f845d15ed0c9eae38c9124e30f90b2";
        // });

        // 倒计时结束，页面跳转,;
        // 点击按钮,页面跳转
        window.onload = () => {
            let time = 10;
            setInterval(() => {
                time--;
                document.getElementById("jumpTo").innerHTML = time;
                if (time == 0) {
                    location.href = "https://www.bilibili.com/video/BV1ca4y1i7Lz/?spm_id_from=333.337.search-card.all.click&vd_source=14f845d15ed0c9eae38c9124e30f90b2";
                }
            }, 1000);
        }

        document.getElementsByTagName("button")[0].addEventListener("click", () => {
            location.href = "https://www.bilibili.com/video/BV1ca4y1i7Lz/?spm_id_from=333.337.search-card.all.click&vd_source=14f845d15ed0c9eae38c9124e30f90b2";
        });
    </script>
</body>

</html>